
namespace CUtil
{
    using System;
	using System.Data;
	using System.Xml;
	public class XMLAccessData
    {
		protected System.Collections.ArrayList m_arrContent;
		protected string fileName;
		protected DataTable m_dtTable;
		protected System.Data.DataSet m_DataSetShareDetails;
		//protected DataTable m_Table ;
		public XMLAccessData(string strFilename)
        {
			fileName=strFilename;     
        }
		public bool ReadXMLFile(ref DataTable MyTable, ref DataSet ds)
		{
			System.IO.FileStream fstream =null;
			try
			{
				ds = new DataSet();	
				fstream = new System.IO.FileStream(fileName,System.IO.FileMode.Open,System.IO.FileAccess.Read);
				ds.ReadXml(fstream);
				fstream.Close();
				m_dtTable = ds.Tables[0];
				MyTable=m_dtTable;
				return true;
			}
			catch
			{
				if(!(fstream==null)){fstream.Close();}
				return false;
			}
        }
		public bool WriteXML (DataSet MyDataSet)
		{	
			try
			{
				MyDataSet.WriteXml(fileName);			
				return true;
			}
			catch( System.Exception e) 
			{
				throw e;	
			}
		}
		public System.Collections.ArrayList Content
		{
			get{return m_arrContent;}
			set{m_arrContent=value;}
		}
		public DataTable ContentDataTable
		{
			get{return m_dtTable;}
			set{m_dtTable=value;}
		}	
	}
}